import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopLinkController } from '../../../controllers';
const uctoominishopLinkRouter = new Router();
const minishopLinkController = new uctooMinishopLinkController();

uctoominishopLinkRouter.post('/add', requireUser, minishopLinkController.add);
uctoominishopLinkRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_link'), minishopLinkController.edit);
uctoominishopLinkRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_link'), minishopLinkController.delete);

//For getting minishopLink with permission control
uctoominishopLinkRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_link'), minishopLinkController.getSingle);
uctoominishopLinkRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_link'), minishopLinkController.getMany);
uctoominishopLinkRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_link'), minishopLinkController.getMany);

//#endregion AutoCreateCode
export default uctoominishopLinkRouter;
